<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>首页</title>
		<meta name="Author" content="余光cc" /> 
        <meta name="Copyright" content="网站版权" /> 
        <meta name="keywords" content="网站关键字" />
        <meta name="description" content="网站描述" />
        <link rel="Shortcut Icon" href="网站.ico图标路径" />
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="css/mapTk.css"/>
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
	</head>
	<body>
	<div class="box-kt" style="background: url(images/map-tk.png) no-repeat;">
		<div class="box-left">
			<div class="box-left-item zbmc">
				<p>支部名称：<span></span></p>
			</div>
			<div class="box-left-item zbsj">
				<p>支部书记：<span></span></p>
			</div>
			<div class="box-left-item ">
				<p>支部党员：</p>
			</div>
			<div class="box-left-tuanyuan zbdy">
				
			</div>
		</div>
		<div class="box-right">
			<div class="box-right-top">
				<h3>月度工作计划</h3>
				<div class="box-right-top-item">
				</div>
			</div>
			<div class="box-right-bottom">
				<h3>三会一课</h3>
				<div class="box-right-bottom-item" id="li">
					<ul id="LAY_demo1">
						
					</ul>
				</div>
			</div>
		</div>
	</div>
	<script src="js/jquery-3.3.1-min.js" type="text/javascript" charset="utf-8"></script>
	<script src="layui/layui.all.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/echarts.common.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var id = getUrlParms("id");
		$.ajax({
			type:"post",
			url:"/dp/api/branchDetail",
			data:{id:id},
			async:true,
			success:function(data){
				console.log(data);
				$('.zbmc span').text(data.name);
				$('.zbsj span').text(data.leader);
				var str ='';
				$.each(data.user, function(i,v) {
					str += '<span>'+v.name+'</span>';
				});
				$('.zbdy').append(str);
				$('.box-right-top-item').append('<p>'+data.plan.plan+'</p>')
			}
			
		});
		 function getUrlParms(name){
		   var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		   var r = window.location.search.substr(1).match(reg);
		   if(r!=null)
		   return unescape(r[2]);
		   return null;
		   }
		layui.use('flow', function(){
		  var flow = layui.flow;
		 
		  flow.load({
		    elem: '#LAY_demo1' //流加载容器
		    ,scrollElem: '#li' //滚动条所在元素，一般不用填，此处只是演示需要。
		    ,done: function(page, next){ //执行下一页的回调
		      $.ajax({
		      	type:"post",
		      	url:"/dp/api/shykByBranch",
		      	data:{type:2,page:page,id:id},
		      	async:true,
		      	success:function(data){
		      		var lis = [];
		      		$.each(data.list, function(i,v) {
		      			var li = '';
		        	    li +=' <li>';
		        	    li +=' <div class="b-r-b-i-list" data-id="'+v.id+'">';
						li +=' <a href="javascript:;">';
//						li +=' <img src="images/map-tk-img.png" alt="" />';
						li +=' <img src="'+v.imgurl+'" alt="" />';
						li +=' <div class="list-text">';
						li +=' <p>'+v.title+'</p>';
						li +=' <time>'+v.creat_time+'</time>';
						li +=' </div>';
						li +=' </a>';
						li +=' </div>';
						li +=' </li>';
						lis.push(li);
		      		});
		      		setTimeout(function(){
			        //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
			        //pages为Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多
			        next(lis.join(''), page < Math.ceil(data.records / 10)); //假设总页数为 10
			        $('#LAY_demo1 .b-r-b-i-list').unbind().on('click',function(){
			        	var hegit = $(window).height();
			        	var id = $(this).attr('data-id');
			        	layer.open({
					      type: 2,
					      title: '新闻详情',
					      shadeClose: true,
					      shade: false,
					      maxmin: false, //开启最大化最小化按钮
					      area: ['1300px', hegit+'px'],
					      content: 'news-tk.html?id=' + id
					    });
			        })
			      }, 500);
		      	}
		      });
		    }
		  });
		  
		});
	</script>
	 
	</body>
</html>
